function dy = IB_SO(t, y, V_c, J_s)
%IB_BD defines the dynamics of the soma of a deep IB cell.
%   y = [V h_s m_s]
%   V_c = [V_as V_dsA]

% J_s = -4.5; (Mark's) % -1.5; (Aliaa's)
g_NaFs = 50; g_KDRs = 10; g_as = 0.3; 
g_Leak = 1; g_ds = 0.5; C = 1;

dy = zeros(3,1);

I_Leak = g_Leak*(70+y(1));
I_NaF = g_NaFs*(m_0e(y(1))^3)*y(2)*(y(1)-50);
I_KDR = g_KDRs*(y(3)^4)*(95+y(1));
Is_as = -1*g_as*(V_c(1)-y(1));
Is_dsA = -1*g_ds*(V_c(2)-y(1));

dy(1) = (-1/C)*(J_s+I_Leak+I_NaF+I_KDR+Is_as+Is_dsA);

dy(2) = (1/tau_he(y(1)))*(h_infe(y(1))-y(2));

dy(3) = (1/tau_me(y(1)))*(m_infe(y(1))-y(3));

end